package com.zhuiyun.educations.api.live.mapper;

import com.zhuiyun.educations.api.live.entity.LiveEntity;
import com.zhuiyun.educations.common.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


/**
 * @ClassName LiveMapper
 * @Description TODO
 * @Author cjl
 * @Date 2023/6/28 10:48
 **/
@Mapper
public interface LiveMapper extends BaseMapper<LiveEntity> {

    @Select("select count(0) from live where room_num = #{roomNum}")
    Integer checkRoomNum(int roomNum);
    @Select("select * from live where id = #{id}")
    LiveEntity getLiveById(Integer id);
    @Select("select count(0) from live where user_id = #{userId} and live_status = 0")
    Integer checkLiveByUserId(Integer userId);
    @Select("select * from live where user_id = #{userId} and live_status = 0")
    LiveEntity getLiveByUserId(Integer userId);
}
